<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    811. Number of Subarrays with Bounded Maximum
   </h1>
   <p>
    We are given an array
    <code>
     A
    </code>
    of positive integers, and two positive integers
    <code>
     L
    </code>
    and
    <code>
     R
    </code>
    (
    <code>
     L &lt;= R
    </code>
    ).
   </p>
   <p>
    Return the number of (contiguous, non-empty) subarrays such that the value of the maximum array element in that subarray is at least
    <code>
     L
    </code>
    and at most
    <code>
     R
    </code>
    .
   </p>
   <pre>
<strong>Example :</strong>
<strong>Input:</strong> 
A = [2, 1, 4, 3]
L = 2
R = 3
<strong>Output:</strong> 3
<strong>Explanation:</strong> There are three subarrays that meet the requirements: [2], [2, 1], [3].
</pre>
   <p>
    <strong>
     Note:
    </strong>
   </p>
   <ul>
    <li>
     L, R&nbsp; and
     <code>
      A[i]
     </code>
     will be an integer in the range
     <code>
      [0, 10^9]
     </code>
     .
    </li>
    <li>
     The length of
     <code>
      A
     </code>
     will be in the range of
     <code>
      [1, 50000]
     </code>
     .
    </li>
   </ul>
  </div>
  <div>
   <h1 class="question_title">
    811. 区间子数组个数
   </h1>
   <p>
    给定一个元素都是正整数的数组
    <code>
     A
    </code>
    &nbsp;，正整数
    <code>
     L
    </code>
    &nbsp;以及&nbsp;
    <code>
     R
    </code>
    &nbsp;(
    <code>
     L &lt;= R
    </code>
    )。
   </p>
   <p>
    求连续、非空且其中最大元素满足大于等于
    <code>
     L
    </code>
    &nbsp;小于等于
    <code>
     R
    </code>
    的子数组个数。
   </p>
   <pre><strong>例如 :</strong>
<strong>输入:</strong> 
A = [2, 1, 4, 3]
L = 2
R = 3
<strong>输出:</strong> 3
<strong>解释:</strong> 满足条件的子数组: [2], [2, 1], [3].
</pre>
   <p>
    <strong>
     注意:
    </strong>
   </p>
   <ul>
    <li>
     L, R&nbsp; 和&nbsp;
     <code>
      A[i]
     </code>
     都是整数，范围在&nbsp;
     <code>
      [0, 10^9]
     </code>
     。
    </li>
    <li>
     数组&nbsp;
     <code>
      A
     </code>
     &nbsp;的长度范围在
     <code>
      [1, 50000]
     </code>
     。
    </li>
   </ul>
  </div>
 </body>
</html>